<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorate="content">
<head>
<meta charset="utf-8">
<title>OMS进口管理系统—客户</title>
</head>
<body>
	<div layout:fragment="content">
		<table style="width: 100%;" data-bind="with:filter">
			<tbody>
				<tr>
					<td class="td_form01">客户姓名:</td>
					<td class="td_form02"><input type="text"
						data-bind="value:name" /></td>
					<td class="td_form01">客户代码:</td>
					<td class="td_form02"><input type="text"
						data-bind="value:code" /></td>
					<td class="td_form01">联系人</td>
					<td class="td_form02"><input type="text"
						data-bind="value:contact" /></td>
				</tr>
				<tr>
					<td class="td_form01">电话</td>
					<td class="td_form02"><input type="text"
						data-bind="value:phone" /></td>
					<td class="td_form01">邮箱</td>
					<td class="td_form02"><input type="text"
						data-bind="value:email" /></td>
					<td class="td_form01"></td>
					<td class="td_form02"></td>
				</tr>
				<tr>
					<td colspan="3" class="td_form01 text-center"><input
						type="button" class="buttonface" value="清空"
						data-bind="click:$root.empty" /></td>
					<td colspan="3" class="td_form01 text-center"><input
						type="button" class="buttonface" value="查询"
						data-bind="click:$root.search" /></td>
				</tr>
			</tbody>
		</table>
		<div class="Organization_cot">
			<p class="top_bg clearfix">
				<i class="icon popAdd"> <img src="/images/add.png" alt="">
				</i> <a class="Add" data-bind="click:$root.addCustomer">添加</a>
			</p>
		</div>
		<div class="list_page">
			<table>
				<thead>
					<tr>
						<th class="td_top">序号</th>
						<th class="td_top">客户名称</th>
						<th class="td_top">客户代码</th>
						<th class="td_top">联系人</th>
						<th class="td_top">电话</th>
						<th class="td_top">邮箱</th>
						<th class="td_top">操作</th>
					</tr>
				</thead>
				<tbody id="tbody" data-bind="foreach:DataGrid.DataRows">
					<tr>
						<td data-bind="text:$index()+1" style="text-align: center;">7</td>
						<td data-bind="text:name" style="text-align: center;">京猫</td>
						<td data-bind="text:code" style="text-align: center;">11212</td>
						<td data-bind="text:contact" style="text-align: center;">陈总</td>
						<td data-bind="text:phone" style="text-align: center;">13522222222</td>
						<td data-bind="text:email" style="text-align: center;">13522222222@163.com</td>
						<td style="text-align: center;">
							<div class="btn-group">
								<button type="button" data-bind="click:$root.updateCustomer"
									class="pure-button pure-button-primary" data-toggle="dropdown"
									aria-haspopup="true" aria-expanded="false">
									修改<span class="icon-caret-down icon-on-right"></span>
								</button>
								<button type="button" data-bind="click:$root.deleteCustomer"
									class="pure-button button-warning" data-toggle="dropdown"
									aria-haspopup="true" aria-expanded="false">
									删除<span class="icon-caret-down icon-on-right"></span>
								</button>
							</div>
						</td>
					</tr>
				</tbody>
			</table>

			<div id="pop_div_customer" style="display: none; padding: 5px;">
				<table data-bind="with:model" class="table table-hover">
					<tr>
						<td class="td_form01"><label><span class="tip"
								style="color: red;">*</span>客户名称</label></td>
						<td class="td_form02"><input type="text" id="nameCustomer"
							data-bind="value:name"> <span id="nameMessage"
							style="display: none;">客户名称不能为空</span></td>
					</tr>
					<tr>
						<td class="td_form01"><label>客户代码</label></td>
						<td class="td_form02"><input type="text" id="code"
							data-bind="value:code"></td>
					</tr>
					<tr>
						<td class="td_form01"><label><span class="tip">电商代码</span></label></td>
						<td class="td_form02"><input type="text"
							data-bind="value:ciqCode"></td>
					</tr>
					<tr>
						<td class="td_form01"><label>海关注册号</label><span class="tip"></span></td>
						<td class="td_form02"><input type="text"
							data-bind="value:crNumber"></td>
					</tr>
					<tr>
						<td class="td_form01"><label><span class="tip"
								style="color: red;">*</span>联系人</label></td>
						<td class="td_form02"><input type="text" id="contact"
							data-bind="value:contact"> <span id="contactMessage"
							style="display: none;"></span></td>
					</tr>
					<tr>
						<td class="td_form01"><label><span class="tip"
								style="color: red;">*</span>电话</label></td>
						<td class="td_form02"><input type="text" id="phone"
							data-bind="value:phone"></td>
					</tr>
					<tr>
						<td class="td_form01"><label>邮箱</label><span class="tip"></span></td>
						<td class="td_form02"><input id="email" type="text"
							data-bind="value:email" /></td>
					</tr>
					<tr>
						<td class="td_form01"><label>地址</label><span class="tip"></span></td>
						<td class="td_form02"><input type="text"
							data-bind="value:address"></td>
					</tr>
					<tr>
						<td class="td_form01"><label>客户类型</label><span class="tip"></span></td>
						<td class="td_form02"><select data-bind="value:customerType">
								<option value="1">材料商</option>
								<option value="2">供应商</option>
								<option value="3">新加客户</option>
								<option value="4">原始客户</option>
						</select></td>
					</tr>
					<tr>
						<td class="td_form01"><label>默认物流</label><span class="tip"></span></td>
						<td class="td_form02"><input type="text"
							data-bind="value:defaultLogistics">
					</tr>
					<tr>
						<td class="td_form01"><label>状态</label><span class="tip"></span></td>
						<td class="td_form02"><select data-bind="value:valid">
								<option value="0">启用</option>
								<option value="1">禁用</option>
						</select></td>
					</tr>
					<tr>
						<td class="td_form01"><label>备注</label><span class="tip"></span></td>
						<td class="td_form02"><input type="text"
							data-bind="value:note"></td>
					</tr>
					<tr>
						<td class="td_form02 text-center" colspan="2">
							<button type="button" class="saveBtn"
								data-bind="click:$root.submit">
								<i class="iconSave"></i>提交
							</button>
							<button type="button" class="popClose"
								data-bind="click:$root.layerClose">
								<i class="popIcon"></i>取消
							</button>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div th:include="pager :: pager"></div>
	</div>
</body>
</html>
